package com.zfx;


import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;

public class MyApplication {
	private static final Log log = LogFactory.getLog(MyApplication.class);
 	public static void main(String[] args) {
	 ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
		Hello hello = (Hello) ac.getBean("hello");
		System.out.println("hello： "+ hello);
	}

	@Test
	public void t1(){
		log.info("info....");
		log.warn("warn....");
		log.debug("debug...");
		log.error("=======  Log log = LogFactory.getLog(MyApplication.class) ========= ");
	}

	@Test
	public void testBeanFactory(){
		XmlBeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));
		MyTestBean myTestBean = (MyTestBean)beanFactory.getBean("myTestBean");
		log.info(myTestBean);
	}



}
